﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LambdaManAi
{
    public class LabelGenerator
    {
        private int _selectLabelIndex = 0;
        private int _anonymousClosureLabelIndex = 0;
        private int _andOrSelectLabelIndex = 0;

        public Tuple<string, string> GenerateSelectLabels()
        {
            _selectLabelIndex++;
            return new Tuple<string, string>(
                string.Format("select_{0}_true", _selectLabelIndex),
                string.Format("select_{0}_false", _selectLabelIndex));
        }

        public Tuple<string, string> GenerateAndOperatorSelectLabels()
        {
            _andOrSelectLabelIndex++;
            return new Tuple<string, string>(
                string.Format("select_and_{0}_true", _andOrSelectLabelIndex),
                string.Format("select_and_{0}_false", _andOrSelectLabelIndex));
        }

        public Tuple<string, string> GenerateOrOperatorSelectLabels()
        {
            _andOrSelectLabelIndex++;
            return new Tuple<string, string>(
                string.Format("select_or_{0}_true", _andOrSelectLabelIndex),
                string.Format("select_or_{0}_false", _andOrSelectLabelIndex));
        }

        public string GenerateAnonymousClosureLabel()
        {
            _anonymousClosureLabelIndex++;
            return string.Format("anonymous_closure_{0}", _anonymousClosureLabelIndex);
        }
    }
}
